const path=require("path")
const htmlWebpackPlugin=require("html-webpack-plugin")
const VueLoaderPlugin=require("vue-loader/lib/plugin")

module.exports={
    mode:"development",
    entry:"./src/main.js",
    output:{
        path:path.resolve(__dirname,"dist"),
        filename:"bundle.js"
    },
    plugins:[
        new htmlWebpackPlugin({
            template:"./src/index.html"
        }),
        new VueLoaderPlugin()
    ],
    module:{
        rules:[
            {test:/\.css$/,loader:["style-loader","css-loader"]},//css文件
            {test:/\.scss$/,loader:["style-loader","css-loader","sass-loader"]},//node-sass,fibers
            {test:/\.(jpg|jpeg|png|gif|bmp|svg)$/,loader:"url-loader"},//图片loader
            {test:/\.(woff|woff2|ttf|svg|eot)$/,loader:"url-loader"},//字体loader
            {test:/\.vue$/,loader:"vue-loader"},
        ]
    }
}